CC = g++
LD = g++
LIBDIRS ="-L../../lib/" "-L/usr/lib/"
INCLUDEDIR = "/usr/include"
LIBS = "-llcm" "-lmysqlclient"

all:
	make lcmd
	make clean

lcmd: lcmd_config.o lcmd_main.o lcmd_mysql.o lcmd_core.o lcmd_network.o lcmd_error.o
	$(LD) $(LIBDIRS) -I$(INCLUDEDIR) $(LIBS) -o"lcmd" lcmd_config.o lcmd_main.o lcmd_mysql.o lcmd_core.o lcmd_network.o lcmd_error.o

config.o: config.cpp
	$(CC) -c config.cpp

lcmd_main.o: lcmd_main.cpp
	$(CC) -c lcmd_main.cpp

lcmd_core.o: lcmd_core.cpp
	$(CC) -c lcmd_core.cpp

lcmd_network.o:lcmd_network.cpp
	$(CC) -c lcmd_network.cpp

lcmd_mysql.o: lcmd_mysql.cpp
	$(CC) -c lcmd_mysql.cpp
	
lcmd_error.o: lcmd_error.cpp
	$(CC) -c lcmd_error.cpp	

clean:
	rm -rf *.o

